package com.lc.admin.web;

import com.lc.admin.base.ResponseResult;
import com.lc.admin.service.FloorService;
import com.lc.admin.vo.RoomVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/floor")
public class FloorWeb {

    @Autowired
    FloorService floorService;

    @GetMapping("/room/getRoomsWithDeviceByFloorId/{floorId}")
    public ResponseResult queryFloorList(@PathVariable String floorId){
        List<RoomVo> roomVoList = floorService.queryRoomList(floorId);
        return ResponseResult.success(roomVoList);
    }
}
